package com.study.ssm.annotation.life;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @author zhoujunlin
 * @date 2023年07月26日 10:36
 * @desc
 */
@Component
public class Product {

    /**
     * InitializingBean.afterPropertiesSet
     * <bean id="product" class="com.study.ssm.annotation.life.Product" init-method="init"
     */
    @PostConstruct
    public void init() {
        System.out.println("Product.init");
    }

    /**
     * DisposableBean.destroy
     * <bean id="product" class="com.study.ssm.annotation.life.Product" destroy-method="destroy"
     */
    @PreDestroy
    public void destroy() {
        System.out.println("Product.destroy");
    }

}
